/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author cegarciaa
 */
@Entity
@Table(name = "variable")
@NamedQueries({
    @NamedQuery(name = "Variable.findAll", query = "SELECT v FROM Variable v"),
    @NamedQuery(name = "Variable.findByIdvariable", query = "SELECT v FROM Variable v WHERE v.idvariable = :idvariable"),
    @NamedQuery(name = "Variable.findByFecha", query = "SELECT v FROM Variable v WHERE v.fecha = :fecha"),
    @NamedQuery(name = "Variable.findBySp", query = "SELECT v FROM Variable v WHERE v.sp = :sp"),
    @NamedQuery(name = "Variable.findByCaudal", query = "SELECT v FROM Variable v WHERE v.caudal = :caudal"),
    @NamedQuery(name = "Variable.findByPresionin", query = "SELECT v FROM Variable v WHERE v.presionin = :presionin"),
    @NamedQuery(name = "Variable.findByCout", query = "SELECT v FROM Variable v WHERE v.cout = :cout"),
    @NamedQuery(name = "Variable.findByFai2", query = "SELECT v FROM Variable v WHERE v.fai2 = :fai2"),
    @NamedQuery(name = "Variable.findByFai3", query = "SELECT v FROM Variable v WHERE v.fai3 = :fai3"),
    @NamedQuery(name = "Variable.findByFai0", query = "SELECT v FROM Variable v WHERE v.fai0 = :fai0"),
    @NamedQuery(name = "Variable.findByFai1", query = "SELECT v FROM Variable v WHERE v.fai1 = :fai1"),
    @NamedQuery(name = "Variable.findByQdia", query = "SELECT v FROM Variable v WHERE v.qdia = :qdia"),
    @NamedQuery(name = "Variable.findByCin", query = "SELECT v FROM Variable v WHERE v.cin = :cin"),
    @NamedQuery(name = "Variable.findByPresionout", query = "SELECT v FROM Variable v WHERE v.presionout = :presionout"),
    @NamedQuery(name = "Variable.findByQtotal", query = "SELECT v FROM Variable v WHERE v.qtotal = :qtotal")})
public class Variable implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IDVARIABLE")
    private Long idvariable;
    @Column(name = "PRESIONIN")
    private Float presionin;
    @Column(name = "PRESIONOUT")
    private Float presionout;
    @Column(name = "CAUDAL")
    private Float caudal;
    @Column(name = "FAI0")
    private Float fai0;
    @Column(name = "FAI1")
    private Float fai1;
    @Column(name = "FAI2")
    private Float fai2;
    @Column(name = "FAI3")
    private Float fai3;
    @Column(name = "CIN")
    private Float cin;
    @Column(name = "COUT")
    private Float cout;
    @Column(name = "QTOTAL")
    private Float qtotal;
    @Column(name = "QDIA")
    private Float qdia;
    @Column(name = "SP")
    private Float sp;
    @Column(name = "FECHA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @JoinColumn(name = "IDDISPOSITIVO", referencedColumnName = "IDDISPOSITIVO")
    @ManyToOne
    private Dispositivo iddispositivo;

    public Variable() {
    }

    public Variable(Long idvariable) {
        this.idvariable = idvariable;
    }

    public Long getIdvariable() {
        return idvariable;
    }

    public void setIdvariable(Long idvariable) {
        this.idvariable = idvariable;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Float getSp() {
        return sp;
    }

    public void setSp(Float sp) {
        this.sp = sp;
    }

    public Float getCaudal() {
        return caudal;
    }

    public void setCaudal(Float caudal) {
        this.caudal = caudal;
    }

    public Float getPresionin() {
        return presionin;
    }

    public void setPresionin(Float presionin) {
        this.presionin = presionin;
    }

    public Float getCout() {
        return cout;
    }

    public void setCout(Float cout) {
        this.cout = cout;
    }

    public Float getFai2() {
        return fai2;
    }

    public void setFai2(Float fai2) {
        this.fai2 = fai2;
    }

    public Float getFai3() {
        return fai3;
    }

    public void setFai3(Float fai3) {
        this.fai3 = fai3;
    }

    public Float getFai0() {
        return fai0;
    }

    public void setFai0(Float fai0) {
        this.fai0 = fai0;
    }

    public Float getFai1() {
        return fai1;
    }

    public void setFai1(Float fai1) {
        this.fai1 = fai1;
    }

    public Float getQdia() {
        return qdia;
    }

    public void setQdia(Float qdia) {
        this.qdia = qdia;
    }

    public Float getCin() {
        return cin;
    }

    public void setCin(Float cin) {
        this.cin = cin;
    }

    public Float getPresionout() {
        return presionout;
    }

    public void setPresionout(Float presionout) {
        this.presionout = presionout;
    }

    public Float getQtotal() {
        return qtotal;
    }

    public void setQtotal(Float qtotal) {
        this.qtotal = qtotal;
    }

    public Dispositivo getIddispositivo() {
        return iddispositivo;
    }

    public void setIddispositivo(Dispositivo iddispositivo) {
        this.iddispositivo = iddispositivo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idvariable != null ? idvariable.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Variable)) {
            return false;
        }
        Variable other = (Variable) object;
        if ((this.idvariable == null && other.idvariable != null) || (this.idvariable != null && !this.idvariable.equals(other.idvariable))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Variable[idvariable=" + idvariable + "]";
    }

}
